package com.example.comsumer.client;




import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Observer;
import java.util.UUID;
import java.util.concurrent.SynchronousQueue;

/**
 * @ClassName Proxy
 * @Description TODO
 * @Author 11
 * @Date 2021/4/1 17:02
 * @Version 1.0
 */
public class RpcProxy {
    public static <T> T getProxy(final Class<T> interfaceCls,String host,int port) {

        return (T) Proxy.newProxyInstance(interfaceCls.getClassLoader(),new Class<?>[]{interfaceCls},new RemoteInvocationHandler(host,port));

    }
}
